<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
		
		</style>
			<script>
			var w=0;
			function init(){
				var s=document.getElementById("g");
				w=s.getBoundingClientRect().top;
			}
			window.onscroll=function(){
				var s=document.getElementById("g");
				var stop=(document.documentElement||document.body).scrollTop;
				console.log(w+","+stop);
				if(stop>w){
					s.style.position="fixed";
					s.style.top="0px";
					s.style.left="220px";
				}else{
					s.style.position="static";
				}
			}
		</script>
	
	</head>
	<body>
		<input type="text" value="" /><input type="button" value="搜索" id="g"/>
		    <div>
			<img src="../../img/1.jpg" id="er" height="5000px"/>
		</div>
	</body>
</html>
